package com.hrm.mapper;

import com.hrm.pojo.Users;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.sql.SQLException;
import java.util.List;

@Mapper
public interface UsersMapper {
    int deleteByPrimaryKey(Integer id) throws SQLException;

    /*根据用户名查询用户信息*/
    Users selectByLoginname(@Param("loginname") String loginname) throws SQLException;
    /*注册用户*/
    int insertSelective(Users record)throws SQLException;
    /*通过id查询用户信息*/
    Users selectByPrimaryKey(Integer id)throws SQLException;
    /*登录*/
    Users selectByLoginName(String loginName) throws SQLException;
    /*通过id修改密码*/
    int updatePasswordByPrimaryKey(Users record) throws SQLException;
    /*根据用户名和用户状态模糊查询用户列表*/
    List<Users> selectByUsernameAndStatus(@Param("username") String username, @Param("status") Integer status) throws SQLException;
    /*根据多个用户id一次性删除多个用户*/
    int deleteByPrimaryKeys(@Param("ids") Integer[] ids) throws SQLException;
    /*根据用户的id修改用户信息*/
    int updateByPrimaryKeys(Users users) throws SQLException;
    /*根据用户的电话号码查找用户信息*/
    Users selectByPhone(String phone) throws SQLException;
    /*根据用户的电话号码修改用户密码*/
    int updatePasswordByPhone(String phone, @Param("password") String newPassword) throws SQLException;
}